<?php
/*
 * @Date: 2025-03-31 21:38:47
 * @LastEditors: 贾二小 erxiao.jia@outlook.com
 * @LastEditTime: 2025-04-10 22:44:05
 * @FilePath: /admin-laravel/database/seeders/MenuSeeder.php
 */

namespace Database\Seeders;

use App\Models\Menu;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class MenuSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {

        $data = [
            ['parent_id' => 0, 'label' => '控制台', 'icon' => 'Home', 'router_name' => 'admin.home'],
            ['parent_id' => 0, 'label' => '系统设置', 'icon' => 'System', 'router_name' => null],
            ['parent_id' => 0, 'label' => '关于', 'icon' => 'System', 'router_name' => 'admin.abort'],
            ['parent_id' => 2, 'label' => '用户管理', 'icon' => 'User', 'router_name' => 'admin.system.user'],
            ['parent_id' => 2, 'label' => '角色管理', 'icon' => 'EveryUser', 'router_name' => 'admin.system.role'],
            ['parent_id' => 2, 'label' => '权限管理', 'icon' => 'Permissions', 'router_name' => 'admin.system.permission'],
            ['parent_id' => 2, 'label' => '菜单管理', 'icon' => 'ApplicationMenu', 'router_name' => 'admin.system.menu'],

        ];

        Menu::upsert($data, ['id']);
    }
}
